import redis.clients.jedis.Jedis;

import java.util.List;

/**
 * @author Veng Su 1344114844@qq.com
 * @date 2018/4/19 16:34
 */
public class Setnx {
    public static void main(String[] args) {
        Jedis jedis=new Jedis("127.0.0.1",6379);
        //show the diff between set and setnx
//        jedis.set("string","string can be recover by new set");
//        jedis.set("string","string has recovered by new set");
//
//        System.out.println(jedis.get("string"));
//
//        jedis.setnx("setnx","test setnx");
//        jedis.setnx("setnx","this can not be recover");
//        System.out.println(jedis.get("setnx"));
//        //it also adapt in other type , such as Map List HashMap
//
//        jedis.lpush("lpush1","hello","jjjj","kasdfsd");
////        List<String> string1 =jedis.lrange("lpush1",0,10);
//        System.out.println(jedis.lrange("lpush1",0,10));

        System.out.println(jedis.lpop("lpush1"));



    }
}
